<p>在两个不相关的类中具有相同名称的变量很好，但是在类层次结构（如类继承）中执行相同的操作，容易造成混乱出错。</p>

<h2>不规范代码样例</h2>

<pre>
public class Fruit {
  protected Season ripe;
  protected Color flesh;

  // ...
}

public class Raspberry extends Fruit {
  private boolean ripe;  // 不合规
  private static Color FLESH; // 不合规
}
</pre>

<h2>正确的代码样例</h2>

<pre>
public class Fruit {
  protected Season ripe;
  protected Color flesh;

  // ...
}

public class Raspberry extends Fruit {
  private boolean ripened;
  private static Color FLESH_COLOR;
}
</pre>
